package dbmgr

import (
	//"github.com/beego/beego/v2/client/orm"
	"github.com/beego/beego/v2/core/logs"
	beego "github.com/beego/beego/v2/server/web"
)

var GlobalBaseRepo = &BaseRepo{}

func DBInit() {
	dbType, err := beego.AppConfig.String("dbType")
	if err != nil {
		logs.Error("read conf failed")
		return
	}

	if dbType == "sqlite3" {
		sqlite3_init()
	} else {
		logs.Error("other db type not fix, %s", dbType)
		return
	}

	RegisterModels()
}
